__author__ = """Zach Seifts <zach.seifts@gmail.com>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from Products.synchronicity.config import *

schema = Schema((

    TextField(
        name='description',
        widget=TextAreaWidget(
            description="A short summary of the content",
            label="Description",
            label_msgid='synchronicity_label_description',
            description_msgid='synchronicity_help_description',
            i18n_domain='synchronicity',
        ),
        required=True,
        description="A short summary of the content",
        searchable=True,
        label="Description"
    ),

    StringField(
        name='developer',
        widget=StringWidget(
            label="Developer",
            description="The lead developer of this objective.",
            label_msgid='synchronicity_label_developer',
            description_msgid='synchronicity_help_developer',
            i18n_domain='synchronicity',
        ),
        required=False,
        description="The lead developer of this objective.",
        searchable=True,
        label="Developer"
    ),

),
)

Objective_schema = BaseFolderSchema.copy() + \
    schema.copy()


class Objective(BaseFolder):
    """
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(BaseFolder,'__implements__',()),)

    # This name appears in the 'add' box
    archetype_name = 'Objective'

    meta_type = 'Objective'
    portal_type = 'Objective'
    allowed_content_types = ['Task']
    filter_content_types = 1
    global_allow = 0
    #content_icon = 'Objective.gif'
    immediate_view = 'base_view'
    default_view = 'base_view'
    suppl_views = ()
    typeDescription = "Objective"
    typeDescMsgId = 'description_edit_objective'

    _at_rename_after_creation = True

    schema = Objective_schema

    # Methods


registerType(Objective, PROJECTNAME)